package com.mdxq.mall.sale.service.impl;

import com.mybatisflex.core.util.UpdateEntity;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import com.mdxq.mall.sale.entity.FlashPromotionSession;
import com.mdxq.mall.sale.mapper.FlashPromotionSessionMapper;
import com.mdxq.mall.sale.service.FlashPromotionSessionService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * 限时购场次表 服务层实现。
 *
 * @author zdy
 * @since 2025-01-12
 */
@Service
public class FlashPromotionSessionServiceImpl extends ServiceImpl<FlashPromotionSessionMapper, FlashPromotionSession>  implements FlashPromotionSessionService{

    @Override
    @Transactional
    public boolean updateStatus(Long id, Integer status) {
        FlashPromotionSession flashPromotionSession = UpdateEntity.of(FlashPromotionSession.class,id);
        flashPromotionSession.setStatus(status);
        mapper.update(flashPromotionSession,true);
        return true;
    }
}
